<form action="{:request()->url()}" autocomplete="off" class="layui-form layui-card" data-auto="true" method="post">
    <div class="layui-card-body padding-left-40">
        <label class="layui-form-item relative block">
            <span class="color-green font-w7 label-required-prev">绑定上级分类</span>
            <span class="color-desc margin-left-5">Category Parent</span>
            <select class='layui-select' lay-search name='pid'>
                {foreach $cates as $cate}
                {eq name='cate.id' value='$vo.pid|default=0'}
                <option selected value='{$cate.id}'>{$cate.spl|raw}{$cate.name}</option>
                {else}
                <option value='{$cate.id}'>{$cate.spl|raw}{$cate.name}</option>
                {/eq}{/foreach}
            </select>
            <span class="help-block"><b>必选，</b>请选择上级分类或顶级分类（目前最多支持{$cateLevel|default=0}级分类）</span>
        </label>
        <label class="layui-form-item relative block">
            <span class="color-green font-w7">商品分类名称</span>
            <span class="color-desc margin-left-5">Category Name</span>
            <input class="layui-input" name="name" placeholder="请输入分类名称" required value='{$vo.name|default=""}'>
            <span class="help-block"><b>必填，</b>请填写商品分类名称，建议字符不要太长，一般4-6个汉字（如：系统管理）</span>
        </label>
        <div class="layui-form-item relative block">
            <span class="color-green font-w7">商品分类图标</span>
            <span class="color-desc margin-left-5">Category Icon</span>
            <label class="relative block">
                <input class="layui-input" name="cover" placeholder="请上传商品分类图标&nbsp;&nbsp;&nbsp;&nbsp;" value='{$vo.cover|default=""}'>
                <a class="input-right-icon layui-icon layui-icon-upload" data-field="cover" data-file data-type="png,jpg,gif"></a>
            </label>
            <span class="help-block"><b>可选，</b>请上传商品分类图标，需要是 http 可访问的图片资源链接</span>
        </div>
        <label class="layui-form-item relative block">
            <span class="color-green font-w7">商品分类描述</span>
            <span class="color-desc margin-left-5">Category Remark</span>
            <textarea class="layui-textarea" name="remark" placeholder="请输入分类描述">{$vo.remark|default=''}</textarea>
        </label>
    </div>
    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input name='id' type='hidden' value='{$vo.id}'>{/notempty}
    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" data-close data-confirm="确定要取消编辑吗？" type='button'>取消编辑</button>
    </div>
    <script>form.render()</script>
</form>
